import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import travel from '../views/travelAgent/TravelAgentView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/homeMain',
    children: [
      {path: '/attraction', component: () => import('../views/attraction/AttractionView.vue')},
      {path: '/order', component: () => import('../views/order/UnpaidOrderView.vue')},
      {path: '/paidorder', component: () => import('../views/order/PaidOrderView.vue')},
      {path: '/homeMain', component: () => import('../views/HomeMainView.vue')},
      {path: '/hotelHome', component: () => import('../views/hotel/HotelHomeView.vue')},
      {path: '/searchHotel', component: () => import('../views/hotel/SearchHotel.vue')},
      {path: '/hotel', component: () => import('../views/hotel/Hotel.vue')},
      {path: '/travelguide', component: () => import('../views/travelguide/TravelGuide.vue')},
      {path: '/ShanghaiTravelGuide', component: () => import('../views/travelguide/ShanghaiTravelGuide.vue')},
      {path: '/homeMain', component: () => import('../views/HomeMainView.vue')},
      {path: '/travel',
        component: travel,
        redirect: '/tours',
        children: [
          {path:'/tours',component:() => import('../views/travelAgent/ShanXiView.vue')}
        ]
      },
      {path: '/shanxitravelgroup', component: () => import('../views/travelAgent/ShanXiTravelGroup.vue')},
      {path: '/shanxiwutaishan', component: () => import('../views/travelAgent/ShanXiWuTaiShanView.vue')},
    ]
  },
  {path: '/login', component: () => import('../views/LoginView.vue')},
  {path: '/register', component: () => import('../views/RegisterView.vue')},
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
